class HomeEntity {
  List<Category>? _category;
  List<BannerPicture>? _banner;

  List<Category>? get category => _category;

  List<BannerPicture>? get banner => _banner;

  HomeEntity({List<Category>? category, List<BannerPicture>? banner}) {
    _category = category;
    _banner = banner;
  }

  HomeEntity.fromJson(dynamic json) {
    if (json["category"] != null) {
      _category = [];
      json["category"].forEach((v) {
        _category?.add(Category.fromJson(v));
      });
    }
    if (json["banner"] != null) {
      _banner = [];
      json["banner"].forEach((v) {
        _banner?.add(BannerPicture.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    if (_category != null) {
      map["category"] = _category?.map((v) => v.toJson()).toList();
    }
    if (_banner != null) {
      map["banner"] = _banner?.map((v) => v.toJson()).toList();
    }
    return map;
  }
}

class BannerPicture {
  int? _id;
  String? _name;
  String? _imgUrl;

  int? get id => _id;

  String? get name => _name;

  String? get imgUrl => _imgUrl;

  BannerPicture({int? id, String? name, String? imgUrl}) {
    _id = id;
    _name = name;
    _imgUrl = imgUrl;
  }

  BannerPicture.fromJson(dynamic json) {
    _id = json["id"] as int;
    _name = json["name"] as String;
    _imgUrl = json["imgUrl"] as String;
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["name"] = _name;
    map["imgUrl"] = _imgUrl;
    return map;
  }
}

class Category {
  int? _id;
  String? _name;
  String? _imgUrl;

  int? get id => _id;

  String? get name => _name;

  String? get imgUrl => _imgUrl;

  Category({int? id, String? name, String? imgUrl}) {
    _id = id;
    _name = name;
    _imgUrl = imgUrl;
  }

  Category.fromJson(dynamic json) {
    _id = json["id"] as int;
    _name = json["name"] as String;
    _imgUrl = json["imgUrl"] as String;
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["name"] = _name;
    map["imgUrl"] = _imgUrl;
    return map;
  }
}
